package insertpackage;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import javabean.Schedule;

public class Insertsch extends Insert{ 
	public void insertDB(Schedule sche){
        Connection conn = null;
        PreparedStatement pstmt = null;
        
        try {
            conn = getConnection();
            
            pstmt = conn.prepareStatement("insert into SCHEDULE values (?,?,?,?,?)");
            pstmt.setString(1, null);
            pstmt.setString(2, sche.getSchNAME());
            pstmt.setString(3, sche.getEmpID());
            pstmt.setString(4, sche.getSchDATE());
            pstmt.setString(5, sche.getSchTEXT());
            
            pstmt.executeUpdate();
        } catch(SQLException ex) {
            //throw new ScheduleManagerException("insertSchedule", ex);
        } finally {
            if (pstmt != null) try { pstmt.close(); } catch(SQLException ex) {}
            if (conn != null) try { conn.close(); } catch(SQLException ex) {}
        }
    }
}